package com.ghost.data
{
	import com.ghost.utils.BytesUtil;
	
	import flash.utils.ByteArray;

	/**
	 * 发送数据基类 
	 * @author ghost
	 */	
	public class Base_send
	{
		public var msgType:uint;//协议头
		public var body_bytes:ByteArray;//数据体
		private var total_bytes:ByteArray;//需要发送的所有数据
		public function Base_send()
		{
		}
		public function DataToByteArray():ByteArray
		{
			body_bytes = BytesUtil.creatByteArray();
			total_bytes = BytesUtil.creatByteArray();
			total_bytes.writeShort(msgType);
			total_bytes.writeBytes(body_bytes);
			total_bytes.position = 0;
			return total_bytes;
		}
		protected function createBody_bytes() : void
		{
			throw new Error("createBody_bytes");
		}
	}
}